package com.tanyin.demo.shiyan4;

import lombok.Data;

/**
 * @author xdf
 * @date 2024-05-19
 */
@Data
public class Car {
    private Body body;

    private Tire tire;

    public void getInfo(){
        tire.getInfo();
        body.getInfo();
    }

  public static void main(String[] args) {
      Car car=new Car();
      Tire tire=new Tire();
      tire.setType("品牌1");
      car.setTire(tire);
      Body body=new Body();
      body.setCarType(new NormalCarType());
      body.setMaterial(new Alloy());
      body.setRearview(new RearviewElectric());
      CarGate carGate=new CarGateWithBorder();
      CarGate[] carGates={carGate,carGate,carGate,carGate};
      body.setCarGates(carGates);
      Seat seat=new FabricSeat();
      seat.setColor("黑色");
      Seat[] seats={seat,seat,seat,seat};
      body.setSeats(seats);
      car.setBody(body);
      car.getInfo();
  }
}
